package com.haven123.cloudapp.logstash.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@RequestMapping("/log")
@RestController
public class HelloController {

    @RequestMapping("/hello")
    public String hello(HttpServletRequest request){
        log.info("======logstash===========");
        log.info("X-B3-TraceId:{}",request.getHeader("X-B3-TraceId"));
        log.info("X-B3-SpanId:{}",request.getHeader("X-B3-SpanId"));
        log.info("X-B3-ParentSpanId:{}",request.getHeader("X-B3-ParentSpanId"));
        log.info("X-B3-Sampled:{}",request.getHeader("X-B3-Sampled"));
        log.info("X-Span-Name:{}",request.getHeader("X-Span-Name"));
       return "hello logstash";
    }
}
